fix: Handle custom AuthInfo format from fee-abstraction reward distribution txs#978
Draft
vNodesV wants to merge 1 commit into
Draft
fix: Handle custom AuthInfo format from fee-abstraction reward distribution txs#978vNodesV wants to merge 1 commit into
vNodesV wants to merge 1 commit into
Conversation
…bution txs The fee-abstraction module (github.com/cheqd/fee-abstraction/v8) creates reward-distribution transactions with a custom AuthInfo format that embeds CustomRewardEntry data where the standard Fee message belongs. The SDK's DefaultTxDecoder calls unknownproto.RejectUnknownFieldsStrict on AuthInfo bytes, which rejects the non-standard proto fields and prevents these transactions from being decoded for RPC/block explorer queries. Root cause: proto wire type 1 (fixed64) in the CustomRewardEntry's validator-hash field is misinterpreted as a Coin denom length prefix under the standard Fee schema, causing RejectUnknownFieldsStrict to fail with errUnknownField. Fix: CustomTxDecoder wraps the standard decoder. When strict decoding fails, it falls back to lenient gogo/protobuf proto.Unmarshal (which silently drops unknown fields) for the AuthInfo section. The fallback wraps the decoded *coretypes.Tx in a fallbackTx struct that implements sdk.Tx, sdk.FeeTx, sdk.HasValidateBasic, sdk.TxWithMemo, and sdk.TxWithTimeoutHeight via lazy codec-based Any resolution. Files: - app/tx_decoder.go (new): CustomTxDecoder, fallbackDecode, fallbackTx - app/app.go (modified): Wire custom decoder into baseapp.NewBaseApp
vNodesV
marked this pull request as draft
July 18, 2026 02:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The fee-abstraction module (github.com/cheqd/fee-abstraction/v8 v8.0.3-uneven-heights-formula) creates reward-distribution transactions that embed
CustomRewardEntrydata where the standardFeebelongs inAuthInfo. The SDK'sDefaultTxDecodercallsunknownproto.RejectUnknownFieldsStrictonAuthInfobytes, which rejects non-standard proto fields. This makes these transactions undecodable for RPC endpoints and block explorers.Solution
Wraps the standard
TxDecoderwithCustomTxDecoderthat falls back to lenient protobuf decoding when the strict decoder fails on customAuthInfofields.New file:
app/tx_decoder.goCustomTxDecoder— tries strict decoder first; falls back to lenientproto.UnmarshalforAuthInfowhenRejectUnknownFieldsStrictfailsfallbackTxstruct — implementssdk.Tx,sdk.FeeTx,sdk.HasValidateBasic,sdk.TxWithMemo,sdk.TxWithTimeoutHeightusing lazy codec-basedAnyresolution, allowing RPC queries and block explorers to read these transactionsModified:
app/app.gotxConfig.TxDecoder()withCustomTxDecoderand passes tobaseapp.NewBaseAppTesting
go build ./...passes clean